"""窗口悬浮"""
import sys
from PySide6.QtWidgets import QApplication, QWidget
from PySide6.QtCore import Qt

class TopWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("置顶窗口")
        self.setGeometry(300, 300, 300, 200)
        self.setWindowFlags(Qt.WindowStaysOnTopHint)  # 设置置顶
        self.show()


if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = TopWindow()
    sys.exit(app.exec())